﻿
function KeyDown_IsInteger(value, event) {
    var result = true;

    if (event.keyCode == 8) {
    }
    else {
        if (value.length == 0) {
            if (event.keyCode < 49 || event.keyCode > 57) {
                event.preventDefault();
                result = false;
            }
        }
        else {
            if (event.keyCode < 48 || event.keyCode > 57) {
                event.preventDefault();
                result = false;
            }
        }        
    }

    return result;
}

function KeyDown_IsFloat(value, event) {
    var result = true;

    if (event.keyCode == 8) {
    }
    else {
        if (value.length == 0) {
            if (event.keyCode < 49 || event.keyCode > 57) {
                event.preventDefault();
                result = false;
            }
        }
        else {
            if (event.keyCode == 190) {
                result = true;
                return result;
            }
            if (event.keyCode < 48 || event.keyCode > 57) {
                event.preventDefault();
                result = false;
            }
        }
    }

    return result;
}